package day04;

import java.util.Scanner;

public class PracticeE4 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("输入一个整数：");
        int num = scan.nextInt();
        if (num > 0) {
            System.out.println("正数");
        } else if (num < 0) {
            System.out.println("负数");
        } else {
            System.out.println(0);
        }

        System.out.println("输入年份和月份：");
        int year = scan.nextInt(), month = scan.nextInt();
        if (year % 100 != 0 && year % 4 == 0 || year % 400 == 0) {
            System.out.println("该年的天数为：366");
            if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
                System.out.println("该月的天数为：31");
            }
            if (month == 2) {
                System.out.println("该月的天数为：29");
            }
            if (month == 4 || month == 6 || month == 9 || month == 11) {
                System.out.println("该月的天数为：30");
            }
        } else {
            System.out.println("该年的天数为：365");
            if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
                System.out.println("该月的天数为：31");
            }
            if (month == 2) {
                System.out.println("该月的天数为：28");
            }
            if (month == 4 || month == 6 || month == 9 || month == 11) {
                System.out.println("该月的天数为：30");
            }
        }

        for (int year1 = 1900, line = 0; year1 <= 2023; ++year1) {
            if (year1 % 100 != 0 && year1 % 4 == 0 || year1 % 400 == 0) {
                System.out.print(year1 + " ");
                ++line;
            }
            if (line % 10 == 0) {
                System.out.println();
            }
        }
    }
}
